﻿package 华为机试8月23日;

import java.util.Arrays;
import java.util.Scanner;

public class 华为第二题2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            String s = sc.nextLine();
            System.out.println(func(s));
        }
        sc.close();
    }

    private static String func(String s) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < s.length(); i++) {
            if (!sb.toString().contains(String.valueOf(s.charAt(i))))
                sb.append(s.charAt(i));
        }

        String sbs = sb.toString();
        int[] a = new int[sb.length()];
        for (int i = 0; i < a.length; i++) {
            a[i] = Integer.parseInt(String.valueOf(sbs.charAt(i)));
        }
	
        Arrays.sort(a);

        StringBuilder res = new StringBuilder();
        for (int i = a.length - 1; i >= 0; i--) {
            res.append(a[i]);
        }
        return res.toString();
    }
}
